package design.simdi.code.final_paper.site.panels.licente.domenii;

import org.apache.wicket.model.LoadableDetachableModel;

import design.simdi.code.final_paper.core.daos.DomainDao;
import design.simdi.code.final_paper.core.entities.Domain;

/**
 * 
 * @author Marius Dumitriu - (Jun 18, 2010 - 11:42:43 AM)
 * 
 */
public class DetachableDomainModel extends LoadableDetachableModel<Domain> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private final long id;
	private final DomainDao domainDao;

	public DetachableDomainModel(Domain object, DomainDao domainDao) {
		super(object);
		this.id = object.getId();
		this.domainDao = domainDao;
	}

	@Override
	protected Domain load() {
		return domainDao.get(id);
	}

}
